import http from '../../utils/request/request'
const ROOT = '/processing/processing-product-craft'

// 获取所有产品工艺信息（分页）
export function getAllInfoByPage(current = 1, size = 5) {
    return http({
        url: `${ROOT}/page/${current}/${size}`,
        method: 'get'
    })
}

// 根据SKU或者产品名称查询
export function getAllInfoByValue(current = 1, size = 5, value = '') {
    return http({
        url: `${ROOT}/page/${current}/${size}/key/${value}`,
        method: 'get'
    })
}

// 通过id查询产品信息
export function getInfoById(id) {
    return http({
        url: `${ROOT}/${id}`,
        method: 'get'
    })
}

// 添加
export function addInfo(data) {
    return http({
        url: `${ROOT}/`,
        method: 'post',
        data,
    })
}

// 删除
export function delInfoById(id) {
    return http({
        url: `${ROOT}/${id}`,
        method: 'delete'
    })
}

// 修改
export function editInfo(data) {
    return http({
        url: `${ROOT}/`,
        method: 'put',
        data,
    })
}

